function eulerIntegrate(frame) {

    //alert("in euler");

    var thisAtom;

    //Calculate non-bonded forces
    var forces = LJForce(frame);

    // Calculate bonded forces here
    if (trajectory.bonds) {
        forces = bondForce(frame,forces);
    }


    // var velocities = new Array();
    var timestep = $('#timestep').val();

    var newFrame = jQuery.extend(true, {}, frame);

    newFrame.frameNumber += 1;

    // finally, update the positions
    for (var i = 0; i < frame.atoms.length; i++) // loop over every atom
    {
        // NOTE: This alters the new frame object!
        thisAtom = newFrame.atoms[i];
        // thisAtomPos = new PhiloGL.Vec3(parseFloat(thisAtom.x),parseFloat(thisAtom.y),parseFloat(thisAtom.z));
        
        thisAtom.velocity.$add(forces[i].scale(timestep/thisAtom.mass));
        thisAtom.pos.$add(thisAtom.velocity.scale(timestep));
        // console.log(forces[i]*timestep/thisAtom.mass);

        // Assign the new position
        newFrame.atoms[i].x = thisAtom.pos.x;
        newFrame.atoms[i].y = thisAtom.pos.y;
        newFrame.atoms[i].z = thisAtom.pos.z;
        // newFrame.atoms[i].pos = newPos;
        // newFrame.atoms[i].velocity = newVelocity;
    }
    //alert("end of euler");

    return newFrame;
    // console.log(new Date().getMilliseconds());
}

